<ul class="art-menu">
<?php foreach($categories as $category): ?>
  <li>
    <a href="<?php echo url_for('category/view?id='.$category['slug']) ?>">
      <span class="l"></span><span class="r"></span><span class="t"><?php echo $category['name'] ?></span>
    </a>
    <ul>
      <?php foreach($category['subcategories'] as $subcategory): ?>
        <li>
          <a href="<?php echo url_for('subcategory/view?category='.$category['slug'].'&subcategory='.$subcategory['slug']) ?>">
            <span class="l"></span><span class="r"></span><span class="t"><?php echo $subcategory['name'] ?></span>
          </a>
        </li>
      <?php endforeach; ?>
    </ul>
  </li>
<?php endforeach; ?>
</ul>